package edu.bbu.bibliospring.common.dto;

import java.util.Date;

/**
 * Created by anna on 6/5/14.
 */
public class MessageDto extends DataTransferObject {

    private static final long serialVersionUID = 1L;

    private Long id;
    private LocationDto senderLibrary;
    private ProfileDto receiver;
    private String messageContent;
    private Date sentOn;

    public MessageDto() {super(MessageDto.class.getName());}

    public MessageDto(String modelClass) {
        super(modelClass);
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public LocationDto getSenderLibrary() {
        return senderLibrary;
    }

    public void setSenderLibrary(LocationDto senderLibrary) {
        this.senderLibrary = senderLibrary;
    }

    public ProfileDto getReceiver() {
        return receiver;
    }

    public void setReceiver(ProfileDto receiver) {
        this.receiver = receiver;
    }

    public String getMessageContent() {
        return messageContent;
    }

    public void setMessageContent(String messageContent) {
        this.messageContent = messageContent;
    }

    public Date getSentOn() {
        return sentOn;
    }

    public void setSentOn(Date sentOn) {
        this.sentOn = sentOn;
    }

    @Override
    public String toString() {
        return "MessageDto [id=" + this.id + ", sender=" + this.senderLibrary.getLibraryName() + " " + this.senderLibrary.getAddress() + ", receiver=" + this.receiver.getFirstName() + " " + this.receiver.getLastName() +
                ", messageContent=" + this.messageContent + ", sentOn=" + this.sentOn.toString() + "]" ;
    }
}
